<template>
    <div>
        <!-- 其他信息 -->
        <div class="card-wrap flex-column justify-end card-padding">
            <el-form :model="form" label-width="150px">
                <div class="card-title-wrap">
                    <span>订单信息</span>
                    <span></span>
                </div>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="额度申请编号:">
                            <span
                                @click="goToEdDetail($route.query.calcSchemeId)"
                                style="color: #1890ff; cursor: pointer"
                                >{{
                                    $route.query.calcSchemeCode
                                        ? $route.query.calcSchemeCode
                                        : form.calcSchemeCode
                                }}</span
                            >
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" v-if="form.orderId">
                        <el-form-item label="订单编号:">
                            <span
                                style="color: #1890ff; cursor: pointer"
                                @click="orderDetail(form)"
                                >{{ form.orderCode }}</span
                            >
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </div>
</template>
<script>
export default {
    name: "limit",
    props: {
        value: {
            type: Object,
            default: {},
        },
        state: {
            type: String,
            default: "",
        },
    },
    computed: {
        form: {
            get() {
                let that = this;
                const proxy = new Proxy(that.value, {
                    get(target, key) {
                        return Reflect.get(target, key);
                    },
                    set(target, key, value) {
                        that.$emit("input", { ...target, [key]: value });
                        return true;
                    },
                });
                return proxy;
            },
        },
    },
    data() {
        return {};
    },
    created() {},
    methods: {
        goToEdDetail(calcSchemeId) {
            this._toPage({
                path: "/quota/ApplyDetails",
                query: {
                    calcSchemeId,
                },
            });
        },
        // 订单详情
        orderDetail(row) {
            this._toPage({
                name: "OrderDetails",
                query: {
                    type: row.carType,
                    orderId: row.orderId,
                    calcSchemeId: row.calcSchemeId,
                },
            });
        },
    },
};
</script>
<style lang="scss" scoped>
.box {
    width: 100%;
    .title {
        border-left: 3px solid #3280fc;
        padding-left: 5px;
        box-sizing: border-box;
    }
}
.app-container {
    background-color: #fff;
}
</style>
